/**
 * 
 */
package com.taobao.snowsnow.hibernate.service;

import java.util.List;

/**
 * @author Tux
 *
 * 创建时间: 2011-6-7 上午11:10:19
 */
public interface BaseService {
	/**
	 * 新增
	 * @param entity
	 */
	public int create(Object entity) throws Exception;
	/**
	 * 修改
	 * @param entity
	 * @throws Exception
	 */
	public int update(Object entity) throws Exception;
	
	/**
	 * 新建或者更新
	 * @param entity
	 * @throws Exception
	 */
	public int saveOrUpdate(Object entity) throws Exception;
	
	/**
	 * 删除
	 * @param entity
	 * @throws Exception
	 */
	public int remove(Object entity) throws Exception;
	
	/**
	 * 删除多个对象
	 * @param list
	 * @throws Exception
	 */
	@SuppressWarnings("rawtypes")
	public int removeList(List list) throws Exception;  
	
	/**
     * 查找记录总数
     * @param c
     * @return
     * @throws Exception
     */
    public long countByCriteria(Class c); 
}
